package com.zui.entity.product;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.apache.struts2.json.annotations.JSON;

import com.zui.entity.BaseAutoIdEntity;



@Entity
@Table(name="catalog_category",
uniqueConstraints={@UniqueConstraint(name="uc_product_cata_cate",
		columnNames={"catalogId", "categoryId","fromDate"})})
public class CatalogCategory extends BaseAutoIdEntity {
	private static final long serialVersionUID = 1L;
	
	public CatalogCategory() {}
	
	private Catalog catalog;
	private Category category;
	private CatalogCategoryType catalogCategoryType;
	private Date fromDate;
	private Date thruDate;
	private Integer sequenceNum;

	/*------------------------------
	 * getters and annotations
	 --------------------------------*/
	@ManyToOne() @JoinColumn(name="catalogId")
	public Catalog getCatalog() {return catalog;}
	@ManyToOne() @JoinColumn(name="categoryId")
	public Category getCategory() {return category;}
	@ManyToOne	@JoinColumn(name="catalogCategoryTypeId")
	public CatalogCategoryType getCatalogCategoryType() {return catalogCategoryType;}
	public Date getFromDate() {return fromDate;}
	public Date getThruDate() {return thruDate;}
	public Integer getSequenceNum() {return sequenceNum;}
	public void setCatalog(Catalog catalog) {
		this.catalog = catalog;
	}
	public void setCategory(Category category) {
		this.category = category;
	}
	public void setCatalogCategoryType(CatalogCategoryType catalogCategoryType) {
		this.catalogCategoryType = catalogCategoryType;
	}
	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}
	public void setThruDate(Date thruDate) {
		this.thruDate = thruDate;
	}
	public void setSequenceNum(Integer sequenceNum) {
		this.sequenceNum = sequenceNum;
	}
}
